var e = require;
var t = module;
var o = exports;
var Adv_skd=require("./Adv_skd");
Object.defineProperty(o, "__esModule", {value: !0});
var n = e("NotifyEventType"),
    a = e("GlobalParams"),
    i = e("ModuleUI"),
    r = e("AD"),
    s = cc._decorator,
    l = s.ccclass,
    c =
        (s.property,
        (function (e) {
            function t() {
                return (null !== e && e.apply(this, arguments)) || this;
            }
            return (
                __extends(t, e),
                (t.prototype.onDisable = function () {

                    Adv_skd.default.instance.hideBannerAd();
                    Adv_skd.default.instance.hideGridAdLeft();
                    Adv_skd.default.instance.hideGridAdRight();
                    Adv_skd.default.instance.hideGridAdTop();
                    Adv_skd.default.instance.hideGridAdLeftOne();
                    Adv_skd.default.instance.hideGridAdRightOne();
                    Adv_skd.default.instance.hideGridAdButtom();

                }),

                (t.prototype.initView = function () {

                    Adv_skd.default.instance.hideBannerAd();
                    Adv_skd.default.instance.hideGridAdLeft();
                    Adv_skd.default.instance.hideGridAdRight();
                    Adv_skd.default.instance.hideGridAdTop();
                    Adv_skd.default.instance.hideGridAdLeftOne();
                    Adv_skd.default.instance.hideGridAdRightOne();
                    Adv_skd.default.instance.hideGridAdButtom();
                    Adv_skd.default.instance.showGridAdLeft();
                    Adv_skd.default.instance.showGridAdRight();
                    Adv_skd.default.instance.showGridAdTop();
                    Adv_skd.default.instance.showInterstitialAd();

                    e.prototype.initView.call(this);
                }),
                (t.prototype.OnClick = function (t) {
                    switch ((e.prototype.OnClick.call(this, t), t.node.name)) {
                        case "confirmBtn":
                            this.addDeskIcon();
                            break;
                        case "closebtn":
                            this.closeThisView();
                    }
                }),
                (t.prototype.closeThisView = function () {
                    this.node.destroy();
                }),
                (t.prototype.addDeskIcon = function () {
                    var e = this;
                    r.default.getInstance().desktopFlag(function () {
                        r.default.getInstance().addDeskTop(function (t) {
                            t == r.ResultEnum.Success &&
                                ((a.GlobalParams.addDeskIcon.value = !0),
                                e.emitEvent(n.default.SEND_ADD_DESK_ICON),
                                e.node.destroy());
                        });
                    });
                }),
                __decorate([l], t)
            );
        })(i.default));
o.default = c;
